/*
 * Point.h
 *
 *  Created on: Mar 25, 2011
 *      Author: hxu
 */

#ifndef POINT_H_
#define POINT_H_
#include<iostream>

namespace Cxuh {

template<class Type> class Point {
public:
	Point(const Type&, const Type&, const int&);
	Point(Point<Type> *);	// copy a point
	Point(){};	// for inheritance and copy
	virtual ~Point();
	Type getX() const;
	Type getY() const;
	int getZ() const;
	void setX(Type x1){x = x1;};
	void setY(Type y1){y = y1;};
	void setZ(Type z1){z = z1;};
	void setXYZ(Type x1, Type y1, Type z1){x = x1; y = y1; z = z1;};
	int det_quadrant(const Point<Type>& p2) const; // determine which quadrant is p2 in

	Type operator - (const Point<Type>& pt2) const;
	bool operator == (const Point<Type>& pt2) const;
	bool operator != (const Point<Type>& pt2) const;

	template <class TT> friend std::ostream& operator << (std::ostream&, const Point<TT>&);
private:
	Type x, y;
	int z;	// # of plane
};

}

#endif /* POINT_H_ */
